package com.example.gprsswitch;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.util.Log;
import android.view.GestureDetector;
import android.view.Menu;
import android.view.MotionEvent;
import android.widget.TextView;

public class MainActivity extends Activity {

	private ConnectivityManager mCM;
	private GestureDetector gd;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Log.i("TEST=========", "onCreate");
		setContentView(R.layout.activity_main);
		mCM = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);
		TextView myTextView =(TextView)findViewById(R.id.myTextView);
		//boolean isOpen = gprsEnable(false);
		//myTextView.setText(String.valueOf(isOpen));
		gd=new GestureDetector(this,new OnDoubleClick(myTextView,mCM));
	     Intent home = new Intent(Intent.ACTION_MAIN);
	     home.addCategory(Intent.CATEGORY_HOME); 
	     startActivity(home);

	}
	
	 @Override
	      public boolean onTouchEvent(MotionEvent event) {
		
	          return gd.onTouchEvent(event);
	      }

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		
		return true;
	}

	
}
